﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserManagement.ascx.cs" Inherits="Web.Cms.Users.UserManagement" %>
<p class="heading">
    Quản trị người dùng
</p>
<table border="0" cellpadding="2" cellspacing="4" style="width: 100%" id="tblUserManager"
    class="InputBox" runat="server">
    <tr>
        <td>
            <asp:Button Visible="false" ID="btnBack" SkinID="AdminButtonBack" runat="server"  OnClick="btnBack_Click" /></td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblError"  runat="server"></asp:Label>
        </td>
    </tr>
    <tr>
        <td>
            <div class="floatleft">
                <div style="float: left; padding-right: 10px; padding-top: 5px;">
                    Từ khoá:</div>
                <div class="floatleft" style="position: relative; top: 1px;">
                    <img src="/App_Themes/Default/Images/Buttons/8_23inputL.gif" border="0" />
                </div>
                <div class="floatleft" style="position: relative; top: 1px;">
                    <asp:TextBox CssClass="TextBoxStyle" ID="txtKeyword" runat="server"></asp:TextBox>
                </div>
                <div class="floatleft" style="position: relative; top: 1px;">
                    <img src="/App_Themes/Default/Images/Buttons/8_23inputR.gif" />
                </div>
            </div>
            <div style="float: left; padding-left: 20px; width: 300px">
                <div style="float: left; padding-right: 10px; padding-top: 5px;">
                    Theo:
                </div>
                <div class="floatleft">
                    <img src="/App_Themes/Default/Images/Buttons/8_23inputL.gif" border="0" />
                </div>
                <div class="floatleft">
                    <asp:DropDownList ID="dropSearchBy" runat="server" Width="200px" CssClass="DropStyle">
                        <asp:ListItem Value="Username">T&#234;n truy cập</asp:ListItem>
                        <asp:ListItem Value="Email">Thư điện tử</asp:ListItem>
                        <asp:ListItem Value="FirstName">Họ t&#234;n</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div style="float: right; padding-top: -5px;">
                    <asp:ImageButton ID="iBtnSearch" ImageUrl="~/App_Themes/Default/Images/Buttons/view.png"
                        runat="server" />
                </div>
            </div>
        </td>
    </tr>
    <tr>
        <td style="padding-top: 5px;">
            <asp:Repeater ID="rptAlpha" runat="server">
                <ItemTemplate>
                    <asp:HyperLink ID="lnkAlpha" CssClass="Search_Key" runat="server" Font-Underline="false"></asp:HyperLink>
                </ItemTemplate>
                <SeparatorTemplate>
                    |
                </SeparatorTemplate>
            </asp:Repeater>
            <div style="float: right; padding-right: 20px;" runat="server" id="divAddUser">
                <img src="/App_Themes/Default/Images/Buttons/add.png" border="0" />
                <asp:LinkButton ID="lnkAddUser" CssClass="linkAdd" runat="server" OnClick="lnkAddUser_Click">Tạo mới</asp:LinkButton>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            <asp:GridView ID="grdUsers" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                Width="100%" SkinID="AdminGrid" AllowSorting="True" OnRowCommand="grdUsers_RowCommand"
                OnRowDataBound="grdUsers_RowDataBound" OnPageIndexChanging="grdUsers_PageIndexChanging"
                PageSize="50">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>STT</HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblSTT" runat="server"></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="T&#234;n truy cập" DataField="Username" SortExpression="Username" />
                    <asp:BoundField HeaderText="Thư điện tử" DataField="Email" SortExpression="Email" />
                    <asp:BoundField HeaderText="Họ đệm" DataField="FirstName" SortExpression="LastName" />
                    <asp:BoundField HeaderText="T&#234;n" DataField="LastName" SortExpression="FirstName" />
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Thông tin
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                        <ItemTemplate>
                            <asp:Button ID="btnEditProfile" runat="server" CommandName="editprofile" CommandArgument='<%# Eval("UserID") %>'
                                SkinID="IconInfo" ToolTip="Thông tin người dùng" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Mật khẩu
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                        <ItemTemplate>
                            <asp:Button ID="btnResetPassword" runat="server" CommandName="resetpassword" CommandArgument='<%# Eval("UserID") %>'
                                ToolTip="Xét mật khẩu người dùng" CssClass="Icon_Key" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Phân nhóm
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="70px" />
                        <ItemTemplate>
                            <asp:Button ID="btnRole" runat="server" CommandName="setrole" CommandArgument='<%# Eval("UserID") %>'
                                ToolTip="Phân nhóm người dùng" SkinID="IconGroup" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                     <asp:TemplateField Visible="false">
                        <HeaderTemplate>
                            Phân chuyên mục
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="100px" />
                        <ItemTemplate>               
                         <asp:Button ID="btnUserZones" runat="server" CommandName="Userzones" CommandArgument='<%# Eval("UserID") %>'
                                ToolTip="Phân chuyên mục người dùng" SkinID="IconUserZones" />
                         
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField>
                        <HeaderStyle HorizontalAlign="Center" />
                        <HeaderTemplate>
                            Xóa</HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="50px" />
                        <ItemTemplate>
                            <asp:Button ID="btnDelete" runat="server" CommandName="deleteuser" CommandArgument='<%# Eval("UserID") %>'
                                ToolTip="Xóa người dùng" SkinID="IconDelete" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </td>
    </tr>
</table>
